<?php

/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2016/3/25
 * Time: 18:32
 */
class Model_Prize extends PhalApi_Model_NotORM{
  protected function getTableName($id){
    return 't_prize';    //用户购买商户的记录
  }
  public function getPrize(){
    return $this->getORM()
      ->select('*')
      ->where('type<>?',0)//分享券
      ->fetchAll();
  }

  /**
   * 获取领奖地址
   */
  public function getAdr($prizeId){
    return $this->getORM()->select('adr')->where('id',$prizeId)->fetchOne();
  }
  /**
   * 获取奖品剩余
   */
  public function getBalance($prizeId){
    return $this->getORM()->select('balance')->where('id',$prizeId)->fetchOne();
  }
}